#pragma once
#include <iostream>
using namespace std;

class Date
{
	friend  ostream& operator<<(ostream& out, const Date& d);
	friend  istream& operator>>(istream& in, Date& d);
public:
	Date(int year=0, int month=0, int day=0)
		:_year(year)
		, _month(month)
		, _day(day)
	{}

	Date(const Date& d)
	{
		_year = d._year;
		_month = d._month;
		_day = d._day;
	}

	~Date()
	{

	}

	Date& operator=(const Date& d);

	Date& operator+=(int day);

	Date operator+(int day);

	Date& operator-=(int day);

	Date operator-(int day);

	bool operator==(const Date& d)const;

	bool operator<(const Date& d)const;

	bool operator<=(const Date& d)const;

	bool operator>(const Date& d)const;

	bool operator>=(const Date& d)const;

	int operator-(const Date& d)const;

	bool operator!=(const Date& d)const;

	Date operator++(int);
	Date& operator++();



private:
	int _year=1;
	int _month=1;
	int _day=1;
};

ostream& operator<<(ostream& out, const Date& d);
istream& operator>>(istream& in, Date& d);
